package com.mlnx.device.pojo.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;


@Data
@ApiModel("设备添加参数类")
public class DeviceForm {

    @NotBlank(message = "设备类型不能为空")
    @ApiModelProperty("设备类型")
    private String deviceType;

    @NotBlank(message = "设备编号不能为空")
    @ApiModelProperty("设备编号")
    private String numeration;

    @ApiModelProperty("通道类型")
    private String channelType;

    @ApiModelProperty("cpuId")
    private String cpuId;

    @ApiModelProperty("设备模式")
    private String runMode;

    public boolean checkEcgDeviceParam() {
        if (channelType == null || channelType.isEmpty())
            return false;

        if (cpuId == null || cpuId.isEmpty())
            return false;

        if (runMode == null || runMode.isEmpty())
            return false;

        return true;
    }
}
